#!/usr/bin/env python3

from spark import Spark

class Package(dict):
    '''软件包信息结构存储(字典)'''
    
    def setValue(self, value):
        left = value.find(':')
        self[value[:left]] = value[left+2:]
        if value[:left] == Spark.KEY_Filename:
            self[value[:left]] = Spark.URI + value[left+2:]

    def setPackage(self, line):
        self.setValue(line)

    def getDescription(self):
        return self[Spark.KEY_Description]

    def setLongDescription(self, value):
        self[Spark.KEY_LongDescription] = value
